<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="estateTag" prefix="estateTag" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>发布拼购</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="../resource/css/global.css"
			type="text/css"></link>
		<link rel="stylesheet" type="text/css"
			href="../resource/css/jqueryui/default/easyui.css"></link>
		<script type="text/javascript" src="../resource/js/jquery-1.4.2.js"></script>
		<script type="text/javascript"
			src="../resource/js/jquery.easyui.min.js"></script>
		<script type="text/javascript"
			src="../resource/js/kindeditor/kindeditor.js"></script>
		<link rel="stylesheet" type="text/css"
			href="../resource/js/kindeditor/skins/default.css"></link>
		<link rel="stylesheet" href="../resource/css/memberCenter/infowithoutmenu.css"
			type="text/css"></link>
	</head>
	<body><estateTag:security></estateTag:security>
		<center><jsp:include page="../index/top.jsp"></jsp:include></center>
		<div style="width: 100%; margin-top: 10px;" align="center">
			<input id="menuCls" type="hidden" value="34">
			<table width="100%" class="layoutTab">
				<tr>
				<!-- 	<td width="20%" align="left" valign="top"><jsp:include
							page="../menu.jsp"></jsp:include></td> -->
					<td valign="top" align="center">
						<form name="form" method="post"
							action="../tpinggou/savePinGou.shtml"
							>
							<div class="position" align="left"><label>您所在的位置：</label>拼购管理模块&nbsp;&nbsp;--&gt;&gt;&nbsp;&nbsp;拼购设置&nbsp;&nbsp;--&gt;&gt;&nbsp;&nbsp;拼购信息维护</div>
							<div class="info_top"></div>
							<div class="info_mid" align="center">
								<table width="710" id="userinfo" border="0" cellpadding="1"
									cellspacing="1">
									<tr>
										<td align="center" colspan="2">
											<b>拼购信息 （<font color="red">*</font> 为必填项）</b>
										</td>
									</tr>
									<tr>
										<td width="16%">
											产品类别
										</td>
										<td align="left">
											<select name="bigCategory" onchange="bigCategoryChange()"
												id="bigCategory">
												<option value="">
													请选择
												</option>
												<s:iterator value="rows">
													<option value="<s:property value="id"/>">
														<s:property value="name" />
													</option>
												</s:iterator>
											</select>
										</td>
									</tr>
									<tr>
										<td width="16%">
											选择子产品类别
										</td>
										<td align="left" id="smallCategory">
											<select name="categoryId" id="categoryId">
												<option value="">
													请选择
												</option>
											</select>
										</td>
									</tr>
									<tr>
										<td width="16%">
											选择符合的产品种类
										</td>
										<td align="left" id="goodsType">
											<select name="typeId">
												<option value="">
													请选择
												</option>
											</select>
										</td>
									</tr>
									<tr>
										<td width="16%">
											选择符合的拼购品牌
										</td>
										<td align="left" id="goods">
										</td>
									</tr>
									<tr>
										<td colspan="2" align="center">
											<!-- 审核状态 未审核 -->
											<input type="submit" value="保存">&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="button" onclick="history.back();" value="返回">
										</td>
									</tr>
								</table>
							</div>
							<div class="info_bottom">
								&nbsp;
							</div>
						</form>
					</td>
				</tr>
			</table>
		</div>
		<input type="hidden" />
		<div style="margin-top: 10px;">
		</div>
		<center> <iframe src="../index/footer.html" width="970" height="120" frameborder="0" scrolling="no"></iframe> </center></body>
	<script type="text/javascript">
   function bigCategoryChange(){
	var bigCategoryValue = $("#bigCategory option:selected").val();
	if(bigCategoryValue != ""){
		$('#smallCategory').html('加载中... ...');
		$('#goods').html('');
		$('#goodsType').html('');
		cacheData = '';
		$.get('../category/category_loadCategoryByPid.shtml?id='+bigCategoryValue+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '<select name="categoryId" id="categoryId" onchange="smallCategoryChange();" ><option value="">请选择</option>';
			for(var i = 0; i < json.length; i++){
				str += '<option value="'+json[i]['id']+'">'+json[i]['name']+'</option>';
			}
			str+='</select>';
			$('#smallCategory').html(str);
		})
	}
}

var cacheData;
function smallCategoryChange(){
	var smallCategoryValue = $("#categoryId option:selected").val();
	if(smallCategoryValue != ""){
		$('#goodsType').html('加载中... ...');
		$.get('../type/type_loadTypeByCategoryId.shtml?categoryId='+smallCategoryValue+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '<select name="typeId" id="typeId" onchange="threechange();" ><option value="">请选择</option>';
			for(var i = 0; i < json.length; i++){
				str += '<option value="'+json[i]['id']+'">'+json[i]['name']+'</option>';
			}
			str+='</select>';
			$('#goodsType').html(str);
		})
		$('#goods').html('加载中... ...');
		$.get('../brand/findAllBrandByCategory.shtml?categoryId='+smallCategoryValue+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '';
			for(var i = 0; i < json.length; i++){
				str += '<label><input type="checkbox" name="brandId"  value="'+json[i]['id']+'"/>'+json[i]['name']+'</label>&nbsp;&nbsp;&nbsp;&nbsp;';
			}
			cacheData = str;
			$('#goods').html(str);
		})
	}
}
function threechange(){
	var value2 = $("#typeId option:selected").val();
	if(value2==undefined)value2='';
	if(value2 != ""){
		$('#goods').html('加载中... ...');
		$.get('../brand/findAllBrandByType.shtml?typeId='+value2+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '';
			for(var i = 0; i < json.length; i++){
				str += '<label><input type="checkbox" name="brandId"  value="'+json[i]['id']+'"/>'+json[i]['name']+'</label>&nbsp;&nbsp;&nbsp;&nbsp;';
			}
			$('#goods').html(str);
		})
	}else{
		$('#goods').html(cacheData);
	}
}

    $(function(){
	    $("#userinfo td").not($("#filter_ke td")).addClass("info_td1");
		$("#userinfo tr").find("td:even").not($("#filter_ke td")).addClass("title_info2");
		$("#userinfo tr").find("td:odd").not($("#filter_ke td")).css("padding-left","5px");
});
  
  
  </script>
</html>
